package com.huluobo.lib_http

import com.zyj.retrofit.adapter.FlowCallAdapterFactory
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

/**
 *  Created by LC on 2025/6/12.
 */
class TokenRetrofitImpl : BaseRetrofitImpl() {
    override fun createRetrofit(): Retrofit {
        return Retrofit.Builder()
            .baseUrl(Const.BASE_URL)
            .client(createHttp()
                .addInterceptor { chain ->
                    chain.proceed(
                        chain.request().newBuilder().addHeader(
                            Const.PARAM_TOKEN,
                            "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjE2ODIsImN0aW1lIjoxNzQ5ODcxOTgzfQ.ss66e4Dow0X7P8Eg8ilXdjuSd-xi_3Nlp0J8D4ro0Bo"
                        ).build()
                    )
                }
                .build())
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(FlowCallAdapterFactory.create())
            .build()
    }
}